import React from 'react';
import { MessageSquare } from 'lucide-react';
import { useAIChat } from '@/contexts/aiChat';

/**
 * 悬浮聊天按钮组件
 * 固定在页面右下角，点击打开聊天窗口
 */
const ChatButton: React.FC = () => {
  const { toggleChat } = useAIChat();

  return (
    <button
      className="fixed bottom-6 right-6 w-14 h-14 rounded-full bg-gray-800 hover:bg-gray-700 
                text-white flex items-center justify-center shadow-lg z-50 transition-colors duration-300"
      onClick={toggleChat}
      aria-label="打开AI助手对话"
    >
      <MessageSquare className="w-6 h-6" />
    </button>
  );
};

export default ChatButton;
